<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVillagePublishTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('village_publish', function (Blueprint $table) {
            $table->increments('id')->comment('乡村在线发布表');
            $table->string('pub_title', 255)->nullable()->comment('发布标题');
            $table->text('pub_content')->nullable()->comment('发布的内容');
            $table->text('pub_intro')->nullable()->comment('简介');
            $table->text('list_img')->nullable()->comment('列表图片');
            $table->text('imgs')->nullable()->comment('多图');
            $table->integer('region_id')->default(0)->comment('所属地区ID（1.北洸村）');
            $table->integer('read_num')->default(0)->comment('阅读次数');
            $table->integer('zan_num')->default(0)->comment('点赞次数');
            $table->integer('like_num')->default(0)->comment('喜欢数');
            $table->integer('collect_num')->default(0)->comment('收藏数');
            $table->integer('share_num')->default(0)->comment('分享次数');
            $table->tinyInteger('is_top')->default(0)->comment('置顶');
            $table->integer('weight')->default(0)->comment('权重');
            $table->tinyInteger('is_show')->default(0)->comment('展示1，隐藏0，默认0');
            $table->integer('user_id')->default(0)->comment('前台用户id');
            $table->integer('admin_id')->default(0)->comment('后台管理员id');
            $table->tinyInteger('is_admin')->default(0)->comment('是否为管理员发布');
            $table->string('contact')->nullable()->comment('联系人');
            $table->string('mobile',20)->nullable()->comment('联系电话');
            $table->tinyInteger('check_status')->default(0)->comment('审核状态，未审核0，未通过1，已通过2');
            $table->timestamp('passed_at')->nullable()->comment('通过时间');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('village_publish', function (Blueprint $table) {
            //
        });
    }
}
